package GenericClass;

import GenericClass.GenericStack;

public class TestGenericStack {
    public static void main(String[] args) {
        // GenericStack创建一个空栈
        GenericStack<String> stack1 = new GenericStack<>();
        stack1.push("London");
        stack1.push("Paris");
        stack1.push("Berlin");
        System.out.println(stack1.toSreing());

        GenericStack<Integer> stack2 = new GenericStack<>();
        stack2.push(1);
        stack2.push(2);
        stack2.push(3);
        System.out.println(stack2.toSreing());

        GenericStack<Integer> stack3 = new GenericStack<>();
        stack3.push(1);
        stack3.push(2);
        stack3.push(3);
        stack3.push(4);
        System.out.println(stack3.toSreing());
        System.out.println(stack3.getSize());


    }
}
